<template>
  <el-drawer v-model="visible" :title="title" size="100%" @close="handleClose">
    <Detail v-if="visible" :id="taskId" />
  </el-drawer>
</template>
<script setup lang="ts">
import { ref, watch } from 'vue'
import Detail from '../detail.vue'

const props = defineProps({
  modelValue: Boolean,
  taskId: Number,
  title: { type: String, default: '主任务详情' }
})
const emit = defineEmits(['update:modelValue'])
const visible = ref(props.modelValue)

watch(() => props.modelValue, v => visible.value = v)
watch(visible, v => emit('update:modelValue', v))

const handleClose = () => {
  visible.value = false
}
</script> 